package com.bw.day2task.http;

import android.content.Context;

import com.blankj.utilcode.util.LogUtils;
import com.bw.day2task.App;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.internal.platform.Platform;

public class MyInterceptor implements Interceptor {
    @Override
    public Response intercept(Chain chain) throws IOException {


        String string = App.context.getSharedPreferences("user", Context.MODE_PRIVATE).getString("token", "");
        Request build = chain.request().newBuilder().addHeader("token", string).build();
        Platform.get().log(Platform.INFO,"token2:",null);
        return chain.proceed(build);
    }
}
